import React, { lazy } from "react";

import LazyLoad from "./LazyLoad";

const Home = lazy(() => import("../pages/Home"));
const About = lazy(() => import("../pages/About"));

const Hot = lazy(() => import("../pages/Hot"));
const Wait = lazy(() => import("../pages/Wait"));

const routes = [
  {
    path: "/home",
    element: <LazyLoad comp={<Home />}></LazyLoad>,
    children: [
      {
        path: "hot",
        element: <LazyLoad comp={<Hot />}></LazyLoad>,
      },
      {
        path: "wait",
        element: <LazyLoad comp={<Wait />}></LazyLoad>,
      },
    ],
  },
  {
    path: "/about",
    element: <LazyLoad comp={<About />}></LazyLoad>,
  },
];

export default routes;
